package com.mydataxweb.common;
/**
 * 公共的返回码
 *      返回码code：
 *          成功：10000
 *          失败：10001
 *          未登录：10002
 *          未授权：10003
 *          抛出异常：99999
 */
public enum ResultCode {

    SUCCESS(true,10000,"操作成功"),
    //---系统错误返回码-----
    FAIL(false,10001,"操作失败"),
    UNAUTHENTICATED(false,10002,"您还未登录"),
    UNAUTHORISE(false,10003,"权限不足"),
    SERVER_ERROR(false,99999,"抱歉，系统繁忙，请稍后重试！"),
    //---用户操作返回码  2xxxx----
    MOBILEORPASSWORDERROR(false,20001,"用户名或密码错误");

    private int code;
    private boolean success;
    private String message;

    ResultCode(boolean success,int code, String message) {
        this.code = code;
        this.success = success;
        this.message = message;
    }

   public int code() {
        return code;
   }

    public boolean success() {
        return success;
    }

   public String message() {
        return message;
   }

}
